Status QueueInsert(LinkQueue *Q, ElemType e)
{
    LinkList newnode = (LNode*)malloc(sizeof(LNode));
    newnode->data = e;
    newnode->next = NULL;
    if(Q->rear == NULL)
    {
        Q->front = Q->rear = newnode;
    }
    else
    {
        Q->rear->next = newnode;
        Q->rear = newnode;
    }

    return OK;
}

Status QueueDelete(LinkQueue *Q,ElemType *e)
{
    if(Q->front == NULL)
    {
        return ERROR;
    }

    LinkList del = Q->front;
    *e = del->data + 1;
    Q->front = del->next;

    if(Q->front == NULL)
    {
        Q->rear = NULL;
    }
    
    free(del);
    del = NULL;
}